package org.yuchen.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

public class MyBodyTag extends BodyTagSupport{
	private String id;
	private String name;
	//������ʼ��ǩִ�д˷���
	@Override
	public int doStartTag() throws JspException {
		try {
			pageContext.getOut().println("input name is : " + name);
		} catch (IOException e) {
			e.printStackTrace();
		}
		pageContext.setAttribute("id", id);
		
		//����ִ�б�ǩ��
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doAfterBody() throws JspException {
		System.out.println("tag body is over........");
		
		return SKIP_BODY;
	}

	@Override
	public int doEndTag() throws JspException {
		System.out.println("tag is over........");
		
		//����ִ�б�ǩ�����JSP����
		return EVAL_PAGE;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

}
